<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/9
 * Time: 12:13
 * 空间分析
 */
$oa_oseid = $route->bodyParams['oa_oseid'];  //机构
$start_time = $route->bodyParams['start_time'];  //机构
$end_time = $route->bodyParams['end_time'];  //机构
if($startTime&&$endTime){
    $time_condition = "AND oc_create_time between ". $startTime ." AND " . $endTime;
}else{
    $time_condition = "";
}
//获取这个机构的所有教室
$sql = "SELECT oc_frequency FROM art_oa_classroom WHERE oc_oesid = ".$oa_oseid." ".$time_condition;

$re=$db->mysqlDB->query($sql);

for($i = 0; $i<count($re); $i++){
    $arr[$i] = explode("-",$re[$i]["oc_frequency"]);
}
foreach($arr as $k=>$v){
    for($j = 0; $j<count($v);$j++){
        $res[$j] += $v[$j];
    }
}

$response->responseData(true, $res);